<template>
  <div class="report-item-box" @click="toPage(data.resId)">
    <div class="icon-box"></div>
    <div class="title-box">
      <div class="title">{{data.name}}</div>
      <div class="detail-btn">
        查看报告
        <div class="right3-icon"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default() {
        return {};
      }
    },
    index: {
      type: Number,
      default() {
        return 0;
      }
    }
  },
  methods: {
    toPage(uuid) {
      let routerJump = this.$router.resolve({ name: 'InstituteDetail', query: {uuid} });
      window.open(routerJump.href, '_blank');
    }
  }
}
</script>

<style lang="scss" scoped>
.report-item-box {
  overflow: hidden;
  background: #F9F9F9;
  border-radius: 4px;
  padding: 20px 20px 24px;
  margin-bottom: 4px;
  cursor: pointer;
  .icon-box {
    width: 24px;
    height: 24px;
    background: url('../../../assets/report-default.png') no-repeat;
    background-size: cover;
    margin-left: 4px;
    float: left;
    margin-right: 16px;
    margin-top: 12px;
  }
  .title-box {
    width: 296px;
    float: left;
    .title {
      font-size: 16px;
      
      font-weight: 400;
      color: #272727;
      line-height: 24px;
      margin-bottom: 8px;
    }
    .detail-btn {
      width: 94px;
      height: 30px;
      background: #FFFFFF;
      border-radius: 4px;
      font-size: 14px;
      
      font-weight: 400;
      color: #696969;
      line-height: 30px;
      text-align: center;
      .right3-icon {
        width: 14px;
        height: 14px;
        background: url('../../../assets/right3.png') no-repeat;
        background-size: cover;
        display: inline-block;
        vertical-align: middle;
      }
    }
  }
  &:hover {
    background: #D42A31;
    .icon-box {
      width: 24px;
      height: 24px;
      background: url('../../../assets/report-active.png') no-repeat;
      background-size: cover;
      margin-left: 4px;
      float: left;
      margin-right: 16px;
      margin-top: 12px;
    }
    .title-box {
      .title {
        color: #ffffff;
      }
      .detail-btn {
        background: rgba($color: #ffffff, $alpha: 0.5);
        color: #ffffff;
        .right3-icon {
          width: 14px;
          height: 14px;
          background: url('../../../assets/right4.png') no-repeat;
          background-size: cover;
          display: inline-block;
          vertical-align: middle;
        }
      }
    }
  }
}
</style>